/*
 This file 'scale' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-05-31 00:05
 */

$(function () {

	var zoom = 1;
	var $window = $(window);
	var timer;

	var setScale = function () {

		var $height = $window.height();
		var $width = $window.width();
		var whhw = "";

		// if (($height / $width) <= (1080 / 1920)) {
		// 	zoom = ($height / 1080).toFixed(3);
		// 	whhw = "wh"
		// } else {
		// 	zoom = ($width / 1920).toFixed(3);
		// 	whhw = "hw"
		// }

		

		console.log($height / $width, 1080 / 3840)

		zoom = ($width / 3840).toFixed(3);

		$('.wrapper').removeClass("wh hw").addClass(whhw).css({
			'transform': '  scale(' + zoom + ')'
		});
	};


	$window.on('resize', function () {
		clearTimeout(timer);
		timer = setTimeout(function () {
			setScale();
		}, 160);

	});

	setScale();
});

